#include "factory.h"


int main(){
    Factory* factory = new TwoNumberAddOperateFactory();
    TwoNumberOperate* op = factory->CreateTwoNumberOperator();
    op->setNumberA(9);
    op->setNumberB(3);
    std::cout << "two number result:" << op->GetResult() << std::endl;
    delete factory;
    delete op;
    factory = nullptr;
    op = nullptr;
    factory = new TwoNumberSubOperateFactory();
    op = factory->CreateTwoNumberOperator();
    op->setNumberA(9);
    op->setNumberB(3);
    std::cout << "two number result:" << op->GetResult() << std::endl;
    delete factory;
    delete op;
    factory = nullptr;
    op = nullptr;
    factory = new TwoNumberMultipleOperateFactory();
    op = factory->CreateTwoNumberOperator();
    op->setNumberA(9);
    op->setNumberB(3);
    std::cout << "two number result:" << op->GetResult() << std::endl;
    delete factory;
    delete op;
    factory = nullptr;
    op = nullptr;
    factory = new TwoNumberDivideOperateFactory();
    op = factory->CreateTwoNumberOperator();
    op->setNumberA(9);
    op->setNumberB(3);
    std::cout << "two number result:" << op->GetResult() << std::endl;
    delete factory;
    delete op;
    factory = nullptr;
    op = nullptr;
    factory = new TwoNumberResidualOperateFactory();
    op = factory->CreateTwoNumberOperator();
    op->setNumberA(9);
    op->setNumberB(3);
    std::cout << "two number result:" << op->GetResult() << std::endl;
    delete factory;
    delete op;
    factory = nullptr;
    op = nullptr;
    return 0;
}